/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package deatax.state;

import deatax.GameData;
import deatax.display.gui.FinalScorePanel;
import deatax.network.NetworkListener;
import java.awt.BorderLayout;
import javax.swing.JLabel;

/**
 *
 * @author Pieman
 */
public class WinState extends GameState implements NetworkListener {

    public WinState(GameData data) {
        super("Win", data);
    }

    @Override
    public void begin() {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                //data.getFrame().getContentPane().remove(data.getDisplay());
                data.getFrame().getContentPane().removeAll();
                FinalScorePanel fsp = new FinalScorePanel();
                fsp.setResults(data.getMode().getResultOrder());
                data.getFrame().getContentPane().add(fsp, BorderLayout.CENTER);
                
                data.getFrame().validate();
                data.getFrame().repaint();
            }
        });

    }

    @Override
    public void processMessage(int type, String[] arg) {
        commonMessages(type, arg);
    }
}
